var status = -1;
var selectionLog = [];

function action(f, e, d) {
    if (status == 0 && f == 0) {
        cm.dispose();
        return
    }(f == 1) ? status++ : status--;
    selectionLog[status] = d;
    var c = -1;
    if (status <= c++) {
        cm.dispose()
    } else {
        if (status === c++) {
            cm.updateInfoQuest(3888, "dojangRankJob=0;dojangRank2=0");
            var b = new Date();
            var a = cm.getQuestRecord(3846);
            a.setCustomData((b.getYear() - 100) + "/" + (b.getMonth() + 1) + "/" + b.getDate());
            a.setStatus(1);
            cm.getPlayer().updateQuest(a, true);
            var a = cm.getQuestRecord(7279);
            a.setCustomData("0");
            a.setStatus(1);
            cm.getPlayer().updateQuest(a, true);
            cm.updateInfoQuest(14981, "PCAdvantage=0");
            cm.dispose()
        } else {
            cm.dispose()
        }
    }
}

function start() {
    status = -1;
    action(1, 0, 0)
};